﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenExpressApp.Template;
using Csla.Wpf;
using System.ComponentModel;
using System.Windows.Data;
using System.Windows;
using System.Windows.Controls;
using System.Diagnostics;
using OpenExpressApp.WPF.Controls;
using Itenso.Windows.Input;
using Csla;
using Csla.Core;
using OpenExpressApp.Module;
using OpenExpressApp.MetaModel;
using OpenExpressApp.Types;
using System.Windows.Controls.Primitives;
using AvalonDock;
using OpenExpressApp.WPF.Command;

namespace OpenExpressApp.Module.WPF.Templete
{
    public class ListViewController : ViewController
    {
        public ListViewController(ListObjectView view) : base(view) { }

        public new ListObjectView View
        {
            get
            {
                return base.View as ListObjectView;
            }
        }

        protected override Type FindQueryType()
        {
            var entityType = base.View.EntityType;
            var assembly = entityType.Assembly;
            var typeName = entityType.FullName;
            return assembly.GetType(typeName + "List") ??
                assembly.GetType(typeName + "s");
        }

        protected override string FactoryMethod
        {
            get
            {
                return MethodConvention.GetList;
            }
        }
    }
}
